package com.lxn.config;

import org.springframework.amqp.core.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbbitMQConfig {
    /*
    //创建交换机
    @Bean(NAME_EXCHANGE_PAGE_DIRECT)
    public Exchange exchange() {
        //durable(true)持久化，消息队列重启后交换机仍然存在
        return ExchangeBuilder.topicExchange(NAME_EXCHANGE_PAGE_DIRECT).durable(true).build();
    }
    //声明队列
    @Bean(NAME_QUEUE_PAGE_DIRECT)
    public Queue queue() {
        Queue queue = new Queue(NAME_QUEUE_PAGE_DIRECT);
        return queue;
    }

    //消费者把队列绑定交换机
    @Bean
    public Binding bindingQueueInformSms() {
        return BindingBuilder.bind(queue()).to(exchange()).with("sms.*").noargs();
    }*/
}
